Many computer implemented graphical rendering systems have been developed in order to allow for the creation of graphical images comprising a combination of graphical objects. A typical graphical rendering system accepts a number of input graphical objects and combines the objects to produce a resultant image. Such systems typically store software coded descriptions of graphical objects displayed on a page, using a “Page Description Language (‘PDL’)”. A PDL describes each such graphical object including the attributes of each object. Such attributes include the size, shape and colour of each object. A PDL also describes various other attributes of graphical objects such as the opacity (i.e., alpha channel) associated with an object and the compositing operation used to draw the object, as will be discussed below.
Graphical rendering systems are typically configured to combine graphical objects described in a PDL in order to create various formats of output. For example, the output of a graphical rendering system can include a bitmap or rendering commands sent directly to an output system renderer. Many rendering systems perform such a combination of objects by placing the objects, one at a time, into a destination bitmap. As each object is placed into the destination bitmap, a resultant destination bitmap is generated that contains any previously drawn objects plus the object most recently placed in the bitmap. This result is then in turn used as the input for placing further objects. Some rendering systems may generate the final result of a compositing operation for a single pixel at a time, or for a group of pixels by combining each of the objects in an image multiple times, rather than once.
The attributes of each input object determine the effect that an object has on a final image. The ordering of objects is also important in that each object is placed into the resultant bitmap in turn, where later objects may partially or completely obscure earlier objects. Where a PDL describes a plurality of overlapping objects, the objects are typically rendered sequentially on a page, where each subsequent object may partially or completely obscure preceding objects. For example, FIG. 1(a) shows an image 100 resulting from the rendering of three objects A, B and C. FIG. 1(b) shows the operations involved during the rendering of the objects A, B and C. As seen in FIG. 1(b), initially object B is rendered OVER object A to produce the image 103. Then object C is rendered OVER the objects A and B to produce the image 100 shown in FIG. 1(a). As object C was the fmal object to be rendered, object C completely obscures objects A and B in a region 101 where object C overlaps objects A and B. The process of rendering objects one on top of another in this manner is conventionally know as the “Painter's Algorithm”.
Input and output colour information of a graphical rendering system is typically described in terms of an intensity value associated with each colour component of a pixel. For example, for conventional 24 bit Red, Green, and Blue (‘RGB’) colour pixel format, each of the Red, Green and Blue colour components of a pixel is represented by an 8 bit (or byte) value. The value of each of the bytes represents the intensity of a particular colour component (i.e., Red, Green or Blue). Further, each 24 bit pixel has an associated opacity value (i.e., alpha channel) ranging between 0% opacity and 100% opacity. An opacity value of 0% indicates that a pixel is completely transparent whilst an opacity value of 100% indicates that the pixel is completely opaque.
Opacity values allow for a plurality of objects to be placed one on top of another to produce a resultant image, where one or more of the objects may be partially obscured by one or more other transparent objects. The operation of combining objects using opacity values is referred to as compositing. For example, a partially opaque object representing a piece of tinted glass can be placed OVER one or more other objects to produce a resultant image. In order to produce the resultant image, a graphics rendering system combines the colour and opacity values representing the glass with the colour and opacity values of the other objects. The image produced by this combination depicts the other objects as seen through the tinted glass.
As another example of rendering objects using opacity values, FIG. 2(a) shows a partially opaque object F (e.g. having an opacity value of 50%) composited onto a completely opaque object E (i.e., having an opacity value of 100%) to produce a resultant image 200. Again, FIG. 2(b) shows the operations involved during the rendering of the objects E and F. In a region 201 of the image 200, where object F overlaps object E, the resultant pixel values represent the combination of object E and object F.
More recently, graphical rendering systems have mathematically extended the Painter's Algorithim process to include operations such as intersecting objects or colour combinations. Such operations can give the effect of intersecting objects or of shining a light onto an object. For example, FIG. 3(a) shows the object F composited onto the object E to produce an image 300, where object E is completely opaque and object F is partially opaque. FIG. 3(b) shows the operations involved during the rendering of the objects E and F, where the compositing operation used to produce the image 300 is an intersection (IN) operation.
FIG. 18 shows the result of each of the above compositing operators together with a variety of other conventional compositing operators, which are conventionally known as “Porter-Duff Compositing Operators”.
Graphical rendering systems can also be configured to combine objects into a group before processing. Generally, such groups of objects are processed as though the objects of the group are joined to produce a single object. The single object can then be placed onto a background image. Objects grouped in such a manner can have operations applied to the group as a whole after all group member objects are combined and before the group is placed on the background image.
FIG. 4(a) shows the result of rendering three objects A, B and C to produce the same image 100 seen in FIG. 1(a). However, as shown in FIG. 4(b), in this instance the objects B and C are initially combined to form group X. Group X is then composited onto object A to produce the resultant image 100.
In an extension of the example of FIG. 4(a), each of the objects within a group (e.g. the group X) can be drawn onto a background image (e.g. object A) using a different compositing operation. For example, different objects of a group may be intersected with a background image or may act as a lighting condition on the background image. The technique of initially combining objects to produce a single object, then placing the combined result on a background is not suitable when objects are grouped together to form a single object (e.g. group X). Such a technique is not suitable as the operations associated with each of the individual objects of a group and which are required to be performed to separately combine each object with the background image, are not performed if the objects are grouped.
As an example, FIG. 5(a) shows an image 501 resulting from the compositing of an object E onto an object A, using an OVER operator. An object F is then composited onto the image 501 using an intersection (IN) operator to produce the image 500 shown in FIG. 5(b). The compositing expression for the image 500 is, therefore, (F IN (E OVER A)).
In contrast, FIG. 6(a) shows the operations involved in the rendering of the objects E, A and F, where objects E and F are initially grouped together to produce group Y. The compositing expression for the image 600 is ((F IN E) OVER A). The operations of FIG. 6(a) produce an image 600 shown in FIG. 6(b). As can be seen from a comparison of FIGS. 5(b) and 6(b), due to the different association of the objects A, E and F, the image 500 is different to the image 600. The grouping of the objects E and F results in the operation (F OVER A) not being performed in producing the image 600.
To render a grouped plurality of objects onto a background image, a conventional rendering system typically takes a copy of the background image and then renders each of the objects in the group onto the copy. Such a rendering system then calculates the percentage of background colour in the resultant image copy and removes this background colour from the image copy. The rendering system then applies operations to the group as a whole. The result of such operations is then composited onto the original background using conventional blending operations.
Where one object of a group of objects, adds colour and opacity to a background image, conventional rendering systems using the above process produce an aesthetically satisfactory result for certain conventional compositing operations (i.e., OVER, ATOP, ROVER, Multiply and Plus). However, where one object of such a group removes colour or opacity data from the background image, conventional rendering systems are unable to satisfactorily remove the background image colour from the representation of the group composited onto the background. As such, a group of objects cannot be composited as a whole onto a background image in order to produce an aesthetically satisfactory result for all compositing operations.
Thus, a need clearly exists for a method of compositing graphical objects, which allows a grouped plurality of objects to be composited onto a background image for substantially all compositing operations.